package com.qst.crop.demo.service;

import com.qst.crop.demo.entity.Product;
import com.qst.crop.demo.entity.UserProduct;
import com.qst.crop.demo.mapper.UserProMapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserProService {

    @Autowired
    UserProMapper userProMapper;

    public Integer addFavorite(String userEmail, long productId){
        return userProMapper.addFavorite(userEmail, productId);
    }

    public List<Long> getProList(String userEmail){
        return userProMapper.getProList(userEmail);
    }

    public Integer delFavorite(String userEmail, long productId){
        return userProMapper.delFavorite(userEmail, productId);
    }

    public List<UserProduct> ifExist(String userEmail, long productId){
        return userProMapper.ifExist(userEmail, productId);
    }

}
